# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer:
pkgname=py3-pytoml
pkgver=0.1.21
pkgrel=3
_test_commit=bbfef3b9277eac47e5d6e9e507c99f0a40a61f8a
pkgdesc="TOML-0.4.0 parse/writer for Python3"
url="https://github.com/avakar/pytoml"
arch="noarch"
license="MIT"
depends="python3"
makedepends="py3-setuptools"
checkdepends="py3-pytest"
source="https://files.pythonhosted.org/packages/source/p/pytoml/pytoml-$pkgver.tar.gz
	test-toml-$_test_commit.tar.gz::https://github.com/avakar/toml-test/archive/$_test_commit.tar.gz
	"
builddir="$srcdir/pytoml-$pkgver"

prepare() {
	default_prepare

	rm -rf test/toml-test
	ln -sf "$srcdir"/toml-test-$_test_commit test/toml-test
}

build() {
	python3 setup.py build
}

check() {
	python3 -m pytest
	PYTHONPATH="$PWD" python3 test/test.py
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

sha512sums="6e261e7f979b7beb835061a90d098036b968b9f2e5b4ef74302e7bf59b49651d92e32fb0488831c0bc1325f14a2512e0b7681e8e2bbf59804835179812203875  pytoml-0.1.21.tar.gz
83264fdeb90c8dde3552631569a39252273910ec39cabb5a220c3ef47a40c5f2c4e506c1cbaf4e863cd6e80e38ef7e816df607d95389e66ed3406efff18b802b  test-toml-bbfef3b9277eac47e5d6e9e507c99f0a40a61f8a.tar.gz"
